﻿using Smobiler.Core;
using Smobiler.Core.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FubiManger.Pad
{
    ////ToolboxItem用于控制是否添加自定义控件到工具箱，true添加，false不添加
    //[System.ComponentModel.ToolboxItem(true)]
    partial class Pmenucontrol : Smobiler.Core.Controls.MobileUserControl
    {
        public Pmenucontrol() : base()
        {
            //This call is required by the SmobilerUserControl.
            InitializeComponent();
        }
        /// <summary>
        /// 分类名称
        /// </summary>
        public string businname { get; set; }
        /// <summary>
        /// 分类ID
        /// </summary>
        public string clsid { get; set; }
        /// <summary>
        /// 1下单2加单
        /// </summary>
        public string stype { get; set; }
        private void Pmenucontrol_Load(object sender, EventArgs e)
        {
            btnvalue.Text = businname;
        }

        private void btnvalue_Press(object sender, EventArgs e)
        {
            if (stype == "2")
            {
                ((porderfoodcontrol)this.Owner.Owner.Owner.Owner).RemoveAllStyle();//移除全部样式
                btnvalue.BackColor = System.Drawing.Color.FromArgb(207, 29, 32);//改变背景
                btnvalue.ForeColor = System.Drawing.Color.White;
                ((porderfoodcontrol)this.Owner.Owner.Owner.Owner).Show_name(btnvalue.Text, clsid);//根据菜单显示内容
                
            }
            else
            {
                ((PorderfoodForm)this.Form).RemoveAllStyle();//移除全部样式
                btnvalue.BackColor = System.Drawing.Color.FromArgb(207, 29, 32);//改变背景
                btnvalue.ForeColor = System.Drawing.Color.White;
                ((PorderfoodForm)this.Form).Show_name(btnvalue.Text, clsid);//根据菜单显示内容
            }
        }
    }
}